package cn.js.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

@RestController
public class NewsController {
    @GetMapping("/getNews")
    @PreAuthorize("hasAnyAuthority('sys:news:select')")
    public String getNews() {
        return "news列表";
    }

    @PostMapping("/insertNews")
    @PreAuthorize("hasAnyAuthority('sys:news:add')")

    public String insertNews() {
        return "保存成功";
    }

    @PutMapping("/updateNews")
    @PreAuthorize("hasAnyAuthority('sys:news:update')")
    public String updateNews() {
        return "修改成功";
    }

    @DeleteMapping("/deleteNews")
    @PreAuthorize("hasAnyAuthority('sys:news:delete')")
    public String deleteNews() {
        return "删除成功";
    }
}
